/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "far_ajustes_detalle")
@NamedQueries({
    @NamedQuery(name = "FarAjustesDetalle.findAll", query = "SELECT f FROM FarAjustesDetalle f")})
public class FarAjustesDetalle implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "fad_id")
    private Integer fadId;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "fad_cantidad")
    private BigDecimal fadCantidad;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fad_total")
    private BigDecimal fadTotal;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fad_estado")
    private int fadEstado;
    @Size(max = 2147483647)
    @Column(name = "fad_observacion")
    private String fadObservacion;
    @JoinColumn(name = "fed_id", referencedColumnName = "fed_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarEgresoDetalle farEgresoDetalle;
    @JoinColumn(name = "faj_id", referencedColumnName = "faj_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarAjustes farAjustes;

    public FarAjustesDetalle() {
    }

    public FarAjustesDetalle(Integer fadId) {
        this.fadId = fadId;
    }

    public FarAjustesDetalle(Integer fadId, BigDecimal fadCantidad, BigDecimal fadTotal, int fadEstado) {
        this.fadId = fadId;
        this.fadCantidad = fadCantidad;
        this.fadTotal = fadTotal;
        this.fadEstado = fadEstado;
    }

    public Integer getFadId() {
        return fadId;
    }

    public void setFadId(Integer fadId) {
        this.fadId = fadId;
    }

    public BigDecimal getFadCantidad() {
        return fadCantidad;
    }

    public void setFadCantidad(BigDecimal fadCantidad) {
        this.fadCantidad = fadCantidad;
    }

    public BigDecimal getFadTotal() {
        return fadTotal;
    }

    public void setFadTotal(BigDecimal fadTotal) {
        this.fadTotal = fadTotal;
    }

    public int getFadEstado() {
        return fadEstado;
    }

    public void setFadEstado(int fadEstado) {
        this.fadEstado = fadEstado;
    }

    public String getFadObservacion() {
        return fadObservacion;
    }

    public void setFadObservacion(String fadObservacion) {
        this.fadObservacion = fadObservacion;
    }

    public FarEgresoDetalle getFarEgresoDetalle() {
        return farEgresoDetalle;
    }

    public void setFarEgresoDetalle(FarEgresoDetalle farEgresoDetalle) {
        this.farEgresoDetalle = farEgresoDetalle;
    }

    public FarAjustes getFarAjustes() {
        return farAjustes;
    }

    public void setFarAjustes(FarAjustes farAjustes) {
        this.farAjustes = farAjustes;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fadId != null ? fadId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FarAjustesDetalle)) {
            return false;
        }
        FarAjustesDetalle other = (FarAjustesDetalle) object;
        if ((this.fadId == null && other.fadId != null) || (this.fadId != null && !this.fadId.equals(other.fadId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.FarAjustesDetalle[ fadId=" + fadId + " ]";
    }
    
}
